<template>
    <a-form-item :label="label" :name="formkey" :label-col="labelCol">
        <div class="FormView">
            <a-select v-model:value="Value" style="width: 100%">
                <a-select-option v-for="item in Options" :style="{ fontFamily: item.style }" :value="item.style"
                    :key="item.style">
                    {{ item.name }}
                </a-select-option>
            </a-select>
            <a-button :type="code ? 'primary' : 'default'" class="button" v-if="codeStatus">
                <template #icon>
                    <span class="C-Icon">&#xe6d5;</span>
                </template>
            </a-button>
        </div>
    </a-form-item>
</template>
<script setup>
import { computed, ref } from 'vue';
const props = defineProps(['label', 'code', 'disabled', 'codeStatus', 'labelWidth', 'formkey']);
const Value = defineModel('value');
const labelCol = computed(() => {
    if (props.labelWidth) {
        return { style: { width: props.labelWidth } }
    } else {
        return null
    }
});

const Options = ref([
    { style: "arial, helvetica, 'microsoft yahei'", name: "Arial, Helvetica, 微软雅黑" },
    { style: "arial, helvetica, simhei", name: "Arial, Helvetica, 黑体" },
    { style: "'comic sans ms', 'microsoft yahei'", name: "Comic Sans MS, 微软雅黑" },
    { style: "'comic sans ms', simhei", name: "Comic Sans MS,黑体" },
    { style: "impact, 'microsoft yahei'", name: "Impact, 微软雅黑" },
    { style: "impact, simhei", name: "Impact, 黑体" },
    { style: "'lucida sans unicode', 'microsoft yahei'", name: "Lucida Sans Unicode, 微软雅黑" },
    { style: "'lucida sans unicode', simhei", name: "Lucida Sans Unicode, 黑体" },
    { style: "'trebuchet ms', 'microsoft yahei'", name: "Trebuchet MS, 微软雅黑" },
    { style: "'trebuchet ms', simhei", name: "Trebuchet MS, 黑体" },
    { style: "verdana, 'microsoft yahei'", name: "Verdana,微软雅黑" },
    { style: "verdana, simhei", name: "Verdana, 黑体" },
    { style: "georgia, 'microsoft yahei'", name: "Georgia,微软雅黑" },
    { style: "georgia, simhei", name: "Georgia, 黑体" },
    { style: "'palatino linotype', 'microsoft yahei'", name: "Palatino Linotype,微软雅黑" },
    { style: "'palatino linotype', simhei", name: "Palatino Linotype, 黑体" },
    { style: "'times new roman', 'microsoft yahei'", name: "Times New Roman, 微软雅黑" },
    { style: "'times new roman', simhei", name: "Times New Roman, 黑体" },
    { style: "'courier new', 'microsoft yahei'", name: "Courier New, 微软雅黑" },
    { style: "'courier new', simhei", name: "Courier New, 黑体" },
    { style: "'lucida console', 'microsoft yahei'", name: "Lucida Console, 微软雅黑" },
    { style: "'lucida console', simhei", name: "Lucida Console, 黑体" }
])


</script>
<style lang="less" scoped></style>